<link href="http://localhost/citest/css/style.css" rel="stylesheet" type="text/css"/>
<?php $this->load->view("includes/header")?>
<?php $this->load->view("includes/sidebar-admin")?>
<?php $this->load->view("includes/sidebar-b")?> 

    <div id="content">
        
    <h2>Edit a page</h2>
    <?php echo (isset($mg1))?$mg1:"";
    ?>
        <form id="login" action="" method="post">
            <fieldset>
                <legend>Edit a Page</legend>
                    <div>
                        <label for="page">Page Name: <span class="required">*</span>
                            <?php echo (isset($mg2))?$mg2:"";?>
                        </label>
                        <input type="text" name="page_name" id="page_name" value="<?php echo $page[0]['page_name']; ?>" size="20" maxlength="80" tabindex="1" />
                    </div>
                    
                    <div>
                        <label for="category">All categories: <span class="required">*</span>
                            <?php echo (isset($mg3))?$mg3:"";?>
                        </label>
                        
                        <select name="category">
                            <option><?php 
                            if(isset($cate[0]['cat_name'])) {
                                echo $cate[0]['cat_name']; 
                            }else{echo $cate9[0]['cat_name'];}
                            
                            
                            ?></option>
                            <?php
                            if(isset($categories)){
                                foreach ($categories as $cats){
                                    echo"
                                        <option>{$cats['cat_name']}</option>
                                    ";
                                }
                            }
                            ?>
                        </select>
                    </div>            
                    <div>
                        <label for="page-content">Page Content: <span class="required">*</span> 
                            <?php //echo $page[0]['content']; ?>
                            <?php echo (isset($mg4))?$mg4:""?>
                        </label>
                        <textarea name="content" cols="50" rows="20"><?php echo $page[0]['content']; ?></textarea>
                    </div>
            </fieldset>
            <p><input type="submit" name="submit" value="Add Page" /></p>
        </form>
        
</div><!--end content-->

<?php $this->load->view("includes/footer")?>